/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       hire_hero_dialog.h

	$Header: /game/hire_hero_dialog.h $

	$NoKeywords: $

 ************************************************************************/
#ifndef HIRE_HERO_DIALOG_H_INCLUDED
#define HIRE_HERO_DIALOG_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning( disable: 4786 ) // Disable the ever so helpful "identifier was truncated to '255' characters" warning

#include "bitmap_layer_ptr.h"
#include "bitmap_layer_window_ptr.h"
#include "bitmap_group_ptr.h"
#include "button_group.h"
#include "button_ptr.h"
#include "default_heroes.h"
#include "dialog_box.h"
#include "hero_class.h"
#include "scrollbar_ptr.h"
#include "skill_icon_ptr.h"
#include "text_window_ptr.h"
#include "toggle_button_ptr.h"

class t_adventure_map;
class t_text_edit_window;
// ---------------------------------------------------------
// dialog for hiring heroes
// ---------------------------------------------------------
class t_hire_hero_dialog : public t_dialog_box
{
public:
	t_hire_hero_dialog( int const* hire_costs, int funds, t_adventure_map const& map );

	t_default_hero const& get_data() const;

protected:
	void			change_portrait();
	void			class_selected( t_button*, t_hero_class hero_class );
	void			create_class_buttons();
	virtual void	on_close();
	void			name_change( t_text_edit_window* window );
	void			portrait_change( t_scrollbar* scrollbar, int value );
	void			sex_selected( t_button* button, bool sex );

	struct t_hero_data
	{
		t_bitmap_window_ptr			portrait_window;
		t_bitmap_layer_ptr			portrait;
		std::vector<t_default_hero> heroes;
		int                         selected;
		int                         cost;
		bool                        is_male;
	};

	t_text_window_ptr		m_biography_window;
	t_button_ptr			m_buy_button;
	t_text_window_ptr		m_class_text;
	t_text_window_ptr		m_cost_text;
	t_default_hero			m_current_hero;
	t_toggle_button_ptr		m_female_checkbox;
	int						m_funds;
	t_hero_data				m_hero[k_hero_class_basic_count];
	t_bitmap_group_ptr		m_layout;
	t_toggle_button_ptr		m_male_checkbox;
	t_adventure_map const&	m_map;
	t_text_edit_window*		m_name_window;
	t_scrollbar_ptr			m_scrollbar;
	t_bitmap_window_ptr		m_selected_portrait;
    t_screen_point          m_might_magic_offset;
	t_window_ptr            m_selected_magic_ring;
	t_window_ptr            m_selected_might_ring;
	t_button_group			m_sex_group;
	t_skill_icon_ptr		m_skill_icons[3];
};

inline t_default_hero const& t_hire_hero_dialog::get_data() const
{
	return m_current_hero;
}

#endif // HIRE_HERO_DIALOG_H_INCLUDED
